﻿using Bird.Core.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Bird.Services.Projects;
using Ninject;
using Ninject.Web.Common;
namespace Bird
{
    public class BirdConfig
    {

        public static void Initalize()
        {
            IKernel kernel = EngineContext.Current.Kernel;
            kernel.Bind(typeof(Bird.Data.IDbContext))
                 .ToMethod((context) =>
             {
                 return new Data.BirdObjectContext("Test");
             }).InRequestScope();


            kernel.Bind(typeof(Services.Events.IEventPublisher)).To(typeof(Services.Events.EventPublisher)).InSingletonScope();
            kernel.Bind(typeof(Services.Events.IEventSubcriptionService)).To(typeof(Services.Events.EventSubscriptionService)).InSingletonScope();

            kernel.Bind(typeof(Core.Data.IRepository<>)).To(typeof(Data.EfRepository<>)).InRequestScope();
            kernel.Bind(typeof(Services.Projects.IProjectService)).To(typeof(Services.Projects.ProjectService)).InRequestScope();


        }
    }
}